<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>小城故事多</title>
    <link href="/back/css/style.css" rel="stylesheet" type="text/css" />
    <link href="/back/css/select.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="/manager/xiaochenggushiduo/query">吃住在乡村</a></li>

    </ul>
</div>

<div class="rightinfo">

    <div class="tools">

        <ul class="toolbar">

            <li class="click" onclick="showPage('/manager/xiaochenggushiduo/insert','70%','70%','添加游乐在乡村')"><span><img src="/back/images/t01.png" /></span>添加</li>
        <!-- <li class="click"><span><img src="/back/images/t02.png" /></span>修改</li>
        <li><span><img src="/back/images/t03.png" /></span>删除</li>
        <li><span><img src="/back/images/t04.png" /></span>统计</li> -->
        </ul>
        <ul class="toolbar1">
            <li class="click" onclick="location.replace(location.href);"><span><img src="/back/images/t05.png" /></span>刷新</li>
        </ul>
    </div>

    <form action="/manager/xiaochenggushiduo/query"  id="from">
        <ul class="seachform">
            <li><label>标题</label><input placeholder="输入标题" value="${map.title!''}" name="title" type="text" class="scinput" /></li>
            <li><label>分类</label><div class="vocation">
                <select class="select3" name="typeId">
                    <option value="0"<#if map.typeId = 1>selected="selected"</#if>>全部</option>
                    <#if map.itemTypes??>
                        <#list map.itemTypes as itemType >
                            <option value="${itemType.typeId?c}"<#if map.typeId = itemType.typeId>selected="selected"</#if>>${itemType.typeName!''}</option>
                        </#list>
                    </#if>
                </select>
            </div></li>
            <li><button type="button" class="scbtn" onclick="formSubmit(this,'from');" value="查询">查询</button></li>
        </ul>
    </form>

    <table class="tablelist">
        <thead>
        <tr>
            <!-- <th><input type="checkbox" /></th> -->
            <th>编号<!-- <i class="sort"><img src="/back/images/px.gif" /></i> --></th>
            <th>标题</th>
            <th>图片</th>
            <th>类型</th>
            <th>是否推荐</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <#list list as entity >
        <tr>
            <td>${entity_index + 1}</td>
            <td>${entity.title!''}</td>
            <td title="${entity.cover!''}"><img src="${entity.cover!''}" style="height: 80px; width: 80px"/></td>
            <td>${entity.typeName!''}</td>

            <td>
                <#if entity.isRecommend==0>
                否
                <#else>
                <font color="red">是</font>
            </#if>
            </td>
            <td>
                <a class="tablelink" title="编辑" href="javascript:showPage('/manager/xiaochenggushiduo/update?xiaochenggushiduoId=${entity.xiaochenggushiduoId!''}','70%','70%','模块管理-编辑（${entity.name!''}）)');" >
                    编辑</a> |

                <a class="tablelink"  href="javascript:module_del(this,'${entity.xiaochenggushiduoId?c}');" title="删除">
                    删除</a> |

            <#if entity.isRecommend==0>
                <a class="tablelink"  href="javascript:recommend(this,'${entity.xiaochenggushiduoId?c}');" title="推荐">
                    推荐</a>
            <#else>
                <a class="tablelink"  href="javascript:notRecommend(this,'${entity.xiaochenggushiduoId?c}');" title="取消推荐">
                    取消推荐</a>
            </#if>

            </td>
        </tr>
        </#list>
        </tbody>
    </table>


    <!-- <div class="pagin">
        <div class="message">
            共<i class="blue">1256</i>条记录，当前显示第&nbsp;<i class="blue">2&nbsp;</i>页
        </div>
        <ul class="paginList">
            <li class="paginItem"><a href="javascript:;"><span
                    class="pagepre"></span></a></li>
            <li class="paginItem"><a href="javascript:;">1</a></li>
            <li class="paginItem current"><a href="javascript:;">2</a></li>
            <li class="paginItem"><a href="javascript:;">3</a></li>
            <li class="paginItem"><a href="javascript:;">4</a></li>
            <li class="paginItem"><a href="javascript:;">5</a></li>
            <li class="paginItem more"><a href="javascript:;">...</a></li>
            <li class="paginItem"><a href="javascript:;">10</a></li>
            <li class="paginItem"><a href="javascript:;"><span class="pagenxt"></span></a></li>
        </ul>
    </div> -->
    ${pageInfo!}
</div>

<script src="/back/js/jquery.js" language="JavaScript" ></script>
<script type="text/javascript" src="/back/js/select-ui.min.js"></script>
<script type="text/javascript" src="/back/js/base.js"></script>
<!-- 弹窗js -->
<script src="/back/js/layer/layer.js"></script>
<script type="text/javascript">
    $(document).ready(function(e) {
        $(".select3").uedSelect({
            width : 100
        });
    });
    /*模块-删除*/
    function module_del(obj,typeId){
        layer.confirm('确认要删除吗？',{icon:2},function(index){
            $.post("/manager/xiaochenggushiduo/delete?from=ajax", {'xiaochenggushiduoId': typeId },
                /*  function(result) {processJson(result) */
                function(result) {
                    jsonState(result);
                },'json');
        });
    }
    /*推荐*/
    function recommend(obj,typeId){
        layer.confirm('确认要推荐吗？',{icon:2},function(index){
            $.post("/manager/xiaochenggushiduo/recommend?from=ajax", {'xiaochenggushiduoId': typeId },
                /*  function(result) {processJson(result) */
                function(result) {
                    jsonState(result);
                },'json');
        });
    }

    /*取消推荐*/
    function notRecommend(obj,typeId){
        layer.confirm('确认要取消推荐吗？',{icon:2},function(index){
            $.post("/manager/xiaochenggushiduo/notRecommend?from=ajax", {'xiaochenggushiduoId': typeId },
                /*  function(result) {processJson(result) */
                function(result) {
                    jsonState(result);
                },'json');
        });
    }


</script>
</body>
</html>
